package com.hzgj.bcl.soa.rpc.exception;

/**
 * Created by noname on 15/12/6.
 */
public class RpcException extends RuntimeException {

    private int errorCode;

    public RpcException() {
        super();
    }

    public RpcException(RpcInfo error, Object... args) {
        super(String.format(error.description(), args));
        this.errorCode = error.value();
    }

    public RpcException(String message) {
        super(message);
    }

    public RpcException(String message, Throwable e) {
        super(message, e);
    }

    public RpcException(int errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public RpcException(Throwable cause) {
        super(cause);
    }

    public RpcException(int errorCode, String message, Throwable cause) {
        super(message, cause);
    }

    public int getErrorCode() {
        return errorCode;
    }
}
